﻿using Hu.Core.WebApi.Attributes;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Hu.Core.WebApi.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class SecureController : ControllerBase
    {
        /*
         * 前端调用
         headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  }
         */
        [HuAction("测试权限")]
        [HttpGet]
        public IActionResult GetSecureData()
        {
            return new JsonResult("这是受保护的数据");
            //return Ok("这是受保护的数据");
        }
    }
}
